package
{
	import feathers.controls.Button;
	import feathers.controls.List;
	import feathers.controls.renderers.DefaultListItemRenderer;
	import feathers.controls.renderers.IListItemRenderer;
	import feathers.data.ListCollection;
	import feathers.themes.AeonDesktopTheme;
	import feathers.themes.MetalWorksMobileTheme;
	import feathers.themes.MinimalMobileTheme;
	
	import starling.core.Starling;
	import starling.display.Image;
	import starling.display.Sprite;
	import starling.text.TextField;
	import starling.textures.Texture;
	import starling.textures.TextureAtlas;
	import starling.utils.formatString;
	
	public class Game extends Sprite
	{
		public function Game()
		{
			super();
			//new出个界面主题
			new MetalWorksMobileTheme();
//			new AeonDesktopTheme();
//			new MinimalMobileTheme();
			
			var button : Button = new Button();
			button.label = "hello!";
			button.validate();
			addChild(button);
			
//			var texture : Texture = new Texture();
//			
//			button.defaultSkin = new Image( texture );
			
			
			var list : List = new List();
			list.height = 100;
			list.dataProvider = new ListCollection(
				[
					{ text: "Milk"},
					{ text: "Eggs"},
					{ text: "Bread"},
					{ text: "Chicken"},
					{ text: "Chicken"},
					{ text: "Chicken"}
				]);
			
			list.itemRendererFactory = function():IListItemRenderer
			{
				var renderer:DefaultListItemRenderer = new DefaultListItemRenderer();
				renderer.labelField = "text";
				renderer.iconSourceField = "thumbnail";
				return renderer;
			};
			
			addChild(list);
			list.x = 100;
			
			var string:String = formatString("{0} plus {1} equals {2}", 4, 3, "seven");
			var textfield : TextField = new TextField(200,25,string);
			addChild(textfield);
			textfield.y = 100;
		}
	}
}